<template>
  <div id="centerRight">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span style="margin-top:10px">
          <icon name="chart-pie" class="text-icon"></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2" style="font-size:30px;margin-top:7px;margin-bottom: 15px">整经当班产量</span>
          <!--<dv-decoration-1 class="dv-dec-1"/>-->
        </div>
      </div>
    <div class="up">

      <div
        class="bg-color-black item"
        v-for="item in titleItem"
        :key="item.title"
      >

        <p class="ml-3 colorBlue fw-b fs-xl" style="font-size: 25px">{{ item.title }}</p>

        <div>
          <dv-digital-flop
            class="dv-dig-flop ml-1 mt-2 pl-3"
            :config="item.number"
          />
        </div>

      </div>

    </div>

    </div>
  </div>
</template>

<script>
import CenterChart from '@/components/echart/center/centerChartRate'

export default {
  props:{
    curMachine:{
      type: Object
    }
  },

  data() {
    return {
      titleItem:   [

      ],
      ranking: {},
      water: {
        data: [10,20,30],
        shape: 'roundRect',
        formatter: '{value}%',
        waveNum: 3
      },

    }
  },
  components: {
    CenterChart
  },
  watch:{
    curMachine:{
      handler(curMachine, oldVal){
        this.updateData()

      }
    }
  },
  created(){
    this.updateData()
  },
  methods:{
    updateData(){

        this.titleItem = [
          {
            title: '白班产量(m)',
            number: {
              number: [this.curMachine.warpingBaibangProduct],
              toFixed: 1,
              textAlign: 'right',
              content: '{nt}',
              style: {
                fontSize: 30,
              }
            }
          },
          {
            title: '夜班产量(m)',
            number: {
              number: [this.curMachine.warpingYebangProduct],
              toFixed: 1,
              textAlign: 'right',
              content: '{nt}',
              style: {
                fontSize: 30,
              }
            }
          },

        ]
    },

  }
}
</script>

<style lang="scss">
@import '../../assets/scss/index.scss';

#centerRight {
  display: flex;
  flex-direction: column;

  .up {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;

    .item {
      border-radius: 6px;
      padding-top: 8px;
      margin-top: 8px;
      width: 98%;
      height: 70px;

      .dv-dig-flop {
        width: 150px;
        height: 30px;
      }
    }
  }

  .down {
    padding: 6px 4px;
    padding-bottom: 0;
    width: 100%;
    display: flex;
    height: 255px;
    justify-content: space-between;

    .bg-color-black {
      border-radius: 5px;
    }

    .ranking {
      padding: 10px;
      width: 59%;

      .dv-scr-rank-board {
        height: 225px;
      }
    }

    .dv-dec-1 {
      position: relative;
      width: 100px;
      height: 20px;
      top: -3px;
    }

    .percent {
      width: 40%;
      display: flex;
      flex-wrap: wrap;

      .item {
        width: 50%;
        height: 120px;

        span {
          margin-top: 8px;
          font-size: 14px;
          display: flex;
          justify-content: center;
        }
      }

      .water {
        width: 100%;

        .dv-wa-le-po {
          height: 95%;
        }
      }
    }
  }
}
</style>
